<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增收款信息" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-collectionmoney-add"  class="form-horizontal">
    <input  type="hidden" name="delFlag" value="0">
    <input name="saleOrderNumber" value="${saleOrderNumber}" class="form-control" type="hidden">
    <input name="userId" value="${user.id}" class="form-control" type="hidden">
    <input name="saleUserid" value="1" class="form-control" type="hidden">
    <input name="processStatus" value="1" class="form-control" type="hidden">
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "申请人"/>：
    </label>
        <div class="col-sm-8"><input class="form-control" type="text" value="${user.name}" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售员"/>：
    </label>
        <div class="col-sm-8"><input name="saleUsername" class="form-control" type="text" value="${bpmCrmCollectionmoney.saleUsername?default('张三')}" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售订单编号"/>：
    </label>
        <div class="col-sm-8"><input name="saleCode" class="form-control" type="text" value="${bpmCrmCollectionmoney.saleCode?default('3213213213')}"  readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆识别号"/>：
    </label>
        <div class="col-sm-8"><input name="outCarVin" class="form-control" type="text" value="${bpmCrmCollectionmoney.outCarVin?default('321321')}" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车型"/>：
    </label>
        <div class="col-sm-8"><input name="outCarVehicle" class="form-control" type="text" value="${bpmCrmCollectionmoney.outCarVehicle?default('321321321')}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "付款方式"/>：</label>
        <div class="col-sm-8">
            <@form.select name="paymentMethod" dictType="sys_crm_coll_paymethod" value="${bpmCrmCollectionmoney.paymentMethod?default('')}" required="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "交易日期"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control time-input" name="transactionDate"  data-type="date" data-format="yyyy-MM-dd" type="text"  required/>
            </div>
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "输入金额"/>：
       </label>
        <div class="col-sm-8"><input name="enterAmount" class="form-control" type="number"  required>
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "付款人姓名"/>：
       </label>
        <div class="col-sm-8"><input name="payerName" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "证明"/>：
       </label>
        <div class="col-sm-8">

            <div class="layui-upload">
                <button type="button" class="btn btn-success btn-sm" id="proofList"><i class="fa fa-upload"></i> 上传证明</button>
                <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="demoproofList">
                        </tbody>
                    </table>
                </div>
                <div class="layui-form-item layui-btn-Center">
                    <div class="layui-input-block text-right">
                        <button type="button" class="layui-btn layui-btn-xs" id="proofListAction">开始上传</button>
                    </div>
                </div>
            </div>

        </div>
     </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="payerMemo" class="form-control" required></textarea>
        </div>
    </div>
</@form.form>
</div>
<@footer>
    <script type="text/javascript">
        var prefix = baseURL + "bpm/collectionmoney"
        $("#form-collectionmoney-add").validate({
            focusCleanup: true
        });
        function submitHandler() {
            if (opt.validate.form()) {
                opt.operate.save(prefix + "/add", $('#form-collectionmoney-add').serialize());
            }
        }
        function isNullOrEmpty(value) {
            return value==''||value==null||value==undefined;
        }
        //在插件中使用对象
        $.fn.upfile = function(type) {
            var upfile = new Upfile(this,'',$("input[name='saleOrderNumber']").val(),type);
            layui.use('upload', function() {
                var upload = layui.upload;
                var UplodeIn = upload.render(upfile.options);
                upfile.SetInst(UplodeIn)

            });

        };
        /**
         * 凭证
         */
        $('#proofList').upfile(16);
</script>
</@footer>
</@pageTheme>